<%@ page language="java" pageEncoding="UTF-8"
	errorPage="../../defaultException.jsp"%>
<%@include file="../../tags.jsp"%>
<html>
<head>
<title>勾选目的地推荐的三条特色项信息</title>
<%@include file="../../head.jsp"%>

</head>
<body>
	
		

	<table id="list_data" cellspacing="0" cellpadding="0">  
    <thead>  
        <tr>
       		    
				<th field="zhname" >特色项名称</th>
				<th field="source" formatter="formatMiniCell">图片</th>
					
		</tr>
    </thead>  
	</table>  
<script type="text/javascript">

 function formatMiniCell(value, row, index) {
		return "<img src='${image_domain}"+value+"' width='150' height='100'>";
	}
 
</script>

	<div id="addHomeTitleDialog"
		style="width: 400px; height: 280px; padding: 10px 20px" closed="true">
	</div>
	
	<script type="text/javascript">
$('#list_data').datagrid({ 
    title:'<a href=${cpath }/admin/dest/vlist>目的地</a>&gt&gt'+
	'<a href=${cpath }/admin/dest/feature/vlist?destId=${dest.destId}><c:out value="${dest.zhname}" escapeXml="true" />特色</a>&gt&gt'+
	'<c:out value="${category.featureCategoryName}" escapeXml="true" />', 
    iconCls:'icon-edit',//图标 
    width: 1024, 
    height: 500,
    doSize:true,
    nowrap: false, 
    striped: true, 
    border: true, 
    collapsible:false,//是否可折叠的 
    fitColumns: true,//自动大小 
    fit:false,
    url:'${cpath }/admin/dest/feature/select/item/list?featureId=${feature.featureId}', 
    //sortName: 'code', 
    //sortOrder: 'desc', 
    remoteSort:false,  
    idField:'homeId', 
    singleSelect:true,//是否单选 
    pagination:true,//分页控件 
    rownumbers:true,//行号 
    toolbar: [{ 
        text: '勾选推荐的特色项', 
        iconCls: 'icon-add', 
        handler: function() { 
            var openAction =  cpath +'/admin/dest/feature/select/item/vsave?featureId=${feature.featureId}';
        	openAddDestinationDialog('勾选推荐的特色项',openAction);
        } 
    }]
});
//设置分页控件 
var p = $('#list_data').datagrid('getPager'); 
$(p).pagination({ 
    pageSize: 10,//每页显示的记录条数，默认为10 
    pageList: [5,10,15],//可以设置每页记录条数的列表 
    beforePageText: '第',//页数文本框前显示的汉字 
    afterPageText: '页    共 {pages} 页', 
    displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',
    onBeforeRefresh:function(){
        $(this).pagination('loading');
        alert('before refresh');
        $(this).pagination('loaded');
    }
});  
</script>
	<script type="text/javascript">
		var url;
		var cpath = '${cpath}';
		
		function getSelectDest(){
			return $('#list_data').datagrid('getSelected');
		}
		
		function addDestSuccess(){
			$('#list_data').datagrid('reload'); // reload the user data
		}
		
		function openAddDestinationDialog(dlgtitle,openAction){
			
			$('#addHomeTitleDialog').dialog({  
			    title: dlgtitle ,  
			    width: 800,  
			    height: 400,  
			    closed: false,  
			    cache: false,  
			    resizable:true,
			    href:openAction,  
			    modal: true,
			    closed:true,
			    onClose:function(){
			    	$('#list_data').datagrid('reload');
			    },
			    buttons:[{
					text:'确认',
					iconCls:"icon-ok",
					handler:function(){
						$('#addHomeTitleDialog').dialog('close');
					}
				}]
			});
			$('#addHomeTitleDialog').dialog('open');
		}
	     
		
	</script>
<style type="text/css">
			#fm {
				margin: 0;
				padding: 40px 40px;
			}
			
			.ftitle {
				font-size: 14px;
				font-weight: bold;
				padding: 5px 0;
				margin-bottom: 10px;
				border-bottom: 1px solid #ccc;
			}
			
			.fitem {
				margin-bottom: 5px;
			}
			
			.fitem label {
				display: inline-block;
				width: 90px;
			}
			
		 </style>
</body>
</html>